package local.blueheart.data.springdatademo.task;

import local.blueheart.data.springdatademo.annotation.TaskWorker;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;

@TaskWorker("测试任务")
public class SimpleTask implements Job {

    private static final Logger LOGGER = LoggerFactory.getLogger(SimpleTask.class);

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        LOGGER.info(jobExecutionContext.getTrigger().toString());
        LOGGER.info(jobExecutionContext.getFireInstanceId());
        LOGGER.info(jobExecutionContext.getJobDetail().toString());
        LOGGER.info(String.valueOf(jobExecutionContext.getRefireCount()));
        LOGGER.info("running {}" + new Date());
    }
}
